/**
 *
 */

var app = getApp()
Page({
	data: {
		root: app.setting.att_url,
		banner: [],
		goods: [],
		bannerHeight: Math.ceil(290.0 / 750.0 * getApp().screenWidth)
	},
	onPullDownRefresh: function (){
		var the=this;
		var opt={};
		the.onLoad(opt);
		setTimeout(function(){
			wx.stopPullDownRefresh()
		},1000);
	},
	onLoad: function (options){
		var that = this
		app.util.request({
		  'url': 'entry//mobile',
		  'data': {
			m: 'ewei_shopv2',
			r: 'app.member.favorite.get_list'
		  },
		  'cachetime': '30',
		  success(res) {
			   console.log(res);
			if (!res.errno) {
			  
			  that.setData({
					list: res.data.list,
					info: res.data
			  })
			  
			}
		  },
		  error: function (err) {
                //console.log(err);
          }
		});

	},
	
	detail: function (e) {
		var id = e.currentTarget.dataset.id;
		wx.navigateTo({
			url: "../../goods/detail/index?id=" + id
		});
	},
	remove: function (e) {
		var ids = e.currentTarget.dataset.id;
		var that=this
		app.util.request({
		  'url': 'entry//mobile',
		  'data': {
			m: 'ewei_shopv2',
			r: 'app.member.favorite.remove',
			id:ids
		  },
		  'cachetime': '30',
		  success(res) {
			   console.log(res);
			if (!res.errno) {
			  
			}
		  },
		  error: function (err) {
                //console.log(err);
          }
		});
	},
	index: function () {
		wx.navigateTo({
			url: "../../index/index"
		});
	}

})